<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>编辑</title>
		<link rel="stylesheet" type="text/css" href="../../plugins/layui/css/layui.css" />
		<link href="../../kitAdmin/css/app.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../plugins/select2/dist/css/select2.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../plugins/laydate5.0.9/theme/default/laydate.css" />
	</head>

	<body>
		<div class='kit-table'>
			<div style='margin:10px'>
				<form class='layui-form' action='#' lay-filter='form-edit'>
					<input type='hidden' name='uniqueid' data-link='{:uniqueid}' />
					<div class="layui-form-item">
						<label class='layui-form-label'>加课日期</label>
						<div class='layui-input-inline'>
							<input type='text' placeholder=''  id='_purchaseDate' class='layui-input'>
						</div>
					</div>

					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>上课时间</label>
							<div class='layui-input-inline' style="width: 80px;">
								<select id="hour" >
									<option value="0">00</option>
									<option value="1">01</option>
									<option value="2">02</option>
									<option value="3">03</option>
									<option value="4">04</option>
									<option value="5">05</option>
									<option value="6">06</option>
									<option value="7">08</option>
									<option value="9">09</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>

									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
									<option value="19">19</option>
									<option value="20">20</option>
									<option value="21">21</option>
									<option value="22">22</option>
									<option value="23">23</option>
								</select>
								<!--<input type='text' placeholder=''  id='classTime' class='layui-input' placeholder="HH:mm">-->
							</div>
							<div class="layui-form-mid">:</div>
							<div class="layui-input-inline" style="width: 80px;">
								<select id="mi">
									<option value="00">00</option>
									<option value="15">15</option>
									<option value="30">30</option>
									<option value="45">45</option>
								</select>
							</div>
						</div>
						<div class="layui-input-inline">
						</div>
					</div>
					<div class='layui-form-item'>
						<label class='layui-form-label'>课时</label>
						<div class='layui-input-inline'>
							<input type='text' placeholder='单位:分钟' id='time' name='time' class='layui-input'>
						</div>
<!--						<div class="layui-input-block">-->
<!--							<input type="radio" name="payMethod" value="60" title="60分钟" checked>-->
<!--						</div>-->
					</div>

				</form>
			</div>
		</div>
		<script src="../../common/js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../static/js/base.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/jsviews/jsviews.js" type="text/javascript"></script>
		<script src="../../plugins/select2/dist/js/select2.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/laydate5.0.9/laydate.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/layui/layui.js"></script>
		<script type="text/javascript">
			var purchaseCourseId=getQueryVariable('purchaseCourseId');
			jQuery(document).ready(function() {
				init();
			});
			var callback_save=function(){
				var obj={'purchaseCourseId':purchaseCourseId};
				if(!$('#_purchaseDate').val()){
					alert('请选择上课日期！');
					return;
				}
				var h=$('#hour').val();
				if(!h||!$('#mi').val()){
					alert('请选择上课时间！');
					return;
				}
				obj.classDate=$('#_purchaseDate').val();
				var hn=parseInt(h)+1;
				hn=hn<10?'0'+hn:hn;
				h=h<10?'0'+h:h;
				obj.classTime=h+':'+$('#mi').val();
				obj.classTimeEnd=hn+':'+$('#mi').val();
				obj.classLength=$('#time').val();
				return obj;
			}
			var init=function(){
				laydate.render({
					elem: '#_purchaseDate',
					type: 'date' //默认，可不填 classTime
				});
				laydate.render({
					elem: '#classTime',
					type: 'time' //默认，可不填 classTime
				});
			}
			layui.use(['form', 'laydate'], function() {
				var form = layui.form;
				//监听提交
				form.on('submit(formDemo)', function(data) {
					layer.msg(JSON.stringify(data.field));
					return false;
				});
			});
		</script>
	</body>

</html>
